home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / doc / refcard / rfc.tex < prev   
Text File  |  1997-08-13  |  34KB  |  953 lines

  1. % refcard.tex
  2. %
  3. % This file is TeX source for a reference card describing Octave.
  4. %
  5. % John W. Eaton
  6. % jwe@che.utexas.edu
  7. % Department of Chemical Engineering
  8. % The University of Texas at Austin
  9. %
  10. % Heavily modified by jwe from the source for the gdb reference card,
  11. % which was orignally written by Roland Pesch <pesch@cygnus.com>.
  12. %
  13. %   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  14. %   Permission is granted to make and distribute verbatim copies of
  15. %   this reference provided the copyright notices and permission notices
  16. %   are preserved on all copies.
  17. %
  18. % TeX markup is a programming language; accordingly this file is source
  19. % for a program to generate a reference.
  20. %
  21. % This program is free software; you can redistribute it and/or modify
  22. % it under the terms of the GNU General Public License as published by
  23. % the Free Software Foundation; either version 2, or (at your option)
  24. % any later version.
  25. %
  26. % This program is distributed in the hope that it will be useful, but
  27. % WITHOUT ANY WARRANTY; without even the implied warranty of
  28. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  29. % General Public License for more details.
  30. %
  31. % You can find a copy of the GNU General Public License in the GDB
  32. % manual; or write to the Free Software Foundation, Inc.,
  33. % 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  34. %
  35. % You only have to set the total width and height of the paper, the
  36. % horizontal and vertical margin space measured from *paper edge*
  37. % and the interline and interspec spacing.
  38. % In order to support a new papersize, you have to fiddle with the
  39. % latter four dimensions. Just try out a few values.
  40. % All other values will be computed at process time so it should be
  41. % quite easy to support different paper sizes - only four values to
  42. % guess :-)
  43. %
  44. % To find the configuration places, just search for the string
  45. % "User configuration".
  46. %
  47. %   -- Andreas Vogel (av@ssw.de)
  48. %
  49. % NOTE ON INTENTIONAL OMISSIONS: This reference card includes many
  50. % Octave commands, but due to space constraints there are some things
  51. % I chose to omit.  In general, not all synonyms for commands are
  52. % covered, nor all variations of a command.
  53.  
  54. \def\octaveversion{1.1.1}
  55. \def\refcardedition{1.1}
  56.  
  57. % ------------------
  58. % multicolumn format
  59. % ------------------
  60.  
  61. % Declarations (these must come first)
  62.  
  63. \newdimen\totalwidth
  64. \newdimen\totalheight
  65. \newdimen\hmargin
  66. \newdimen\vmargin
  67. \newdimen\secskip
  68. \newdimen\lskip
  69. \newdimen\barwidth
  70. \newdimen\barheight
  71. \newdimen\intersecwidth
  72.  
  73. \newcount\columnsperpage
  74.  
  75. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  76. %                                                                     %
  77. % CONFIGURATION                                                       %
  78. %                                                                     %
  79. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  80.  
  81. % There are currently 8 total columns, so some of these options will
  82. % not create a single page reference card.
  83.  
  84. % Choose a paper size.  Default is US letter size.
  85.  
  86. \def\refcardafoursize{a4}      % 3 columns, A4 paper (1 in = 254 mm)
  87. \def\refcardlegalsize{legal}   % 4 columns, US legal paper (8.5 x 14in)
  88. \def\refcardlettersize{letter} % 3 columns, US letter paper (8.5 x 14in)
  89.  
  90. \ifx\refcardsize\refcardafoursize
  91.   \columnsperpage=3     % total number of columns to typeset
  92.   \totalwidth=297mm     % total width of paper
  93.   \totalheight=210mm    % total height of paper
  94.   \hmargin=9mm          % horizontal margin width
  95.   \vmargin=7mm          % vertical margin width
  96.   \secskip=3mm          % space between refcard secs
  97.   \lskip=0.4mm          % extra skip between \sec entries
  98. \else
  99.   \ifx\refcardsize\refcardlegalsize
  100.     \columnsperpage=4   % total number of columns to typeset
  101.     \totalwidth=14in    % total width of paper
  102.     \totalheight=8.5in  % total height of paper
  103.     \hmargin=0.20in     % horizontal margin width
  104.     \vmargin=0.25in     % vertical margin width
  105.     \secskip=0.75pc     % space between refcard secs
  106.     \lskip=2pt          % extra skip between \sec entries
  107.   \else
  108.     \columnsperpage=3   % total number of columns to typeset
  109.     \totalwidth=11in    % total width of paper
  110.     \totalheight=8.5in  % total height of paper
  111.     \hmargin=0.25in     % horizontal margin width
  112.     \vmargin=0.25in     % vertical margin width
  113.     \secskip=0.75pc     % space between refcard secs
  114.     \lskip=2pt          % extra skip between \sec entries
  115.   \fi
  116. \fi
  117.  
  118. % Change according to personal taste, not papersize dependent.
  119.  
  120. \barwidth=.1pt       % width of the cropmark bar
  121. \barheight=2pt       % height of the cropmark bar
  122. \intersecwidth=0.5em % width between \itmwid and \dfnwid
  123.  
  124. % Uncomment only one of the following definitions for folding guides.
  125.  
  126. % No printed folding guide:
  127.  
  128. %\def\vdecor{\hskip\hmargin plus1fil
  129. %  \hskip\barwidth plus1fil
  130. %  \hskip\hmargin plus1fil}
  131.  
  132. % Solid line folding guide:
  133.  
  134. %\def\vdecor{\hskip\hmargin plus1fil%
  135. %  \vrule width \barwidth%
  136. %  \hskip\hmargin plus1fil}
  137.  
  138. % For small marks near top and bottom as folding guide:
  139.  
  140. \def\vdecor{\hskip\hmargin plus1fil%
  141.   \vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}%
  142.   \vfill
  143.   \hbox to \barwidth{\vrule height\barheight width\barwidth}}%
  144.   \hskip\hmargin plus1fil}
  145.  
  146. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  147. %                                                                      %
  148. % END CONFIGURATION                                                    %
  149. %                                                                      %
  150. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  151.  
  152. % values to be computed based on above definitions.
  153. % nothing to configure
  154.  
  155. \newdimen\fullhsize          % width of area without margins
  156. \newdimen\itmwid             % width of item column
  157. \newdimen\dfnwid             % width of definition column
  158. \newdimen\idnwid             % width of indented text
  159. \newdimen\temp               % only for temporary use
  160.  
  161. % an alternate section format, used in some cases to make text fit better.
  162.  
  163. \newdimen\altitmwid        % width of item column in altsec
  164. \newdimen\altdfnwid        % width of definition column in altsec
  165.  
  166. % Subtract hmargin for left and right sides of paper from full width.
  167. %
  168. %   fullhsize = totalwidth - (2 * hmargin)
  169.  
  170. \fullhsize=\totalwidth
  171. \temp=\hmargin
  172. \multiply \temp by 2
  173. \advance \fullhsize by -\temp
  174.  
  175. % intercolumn space is composed of hmargin barwidth hmargin so that we
  176. % get the same amount of space on either side of the (optional) rule
  177. % between columns.  For N columns, we need to subtract this amount of
  178. % space N-1 times.  Divide by the number of columns to get the final
  179. % value of \hsize that we use to typeset columns.
  180.  
  181. % hsize = (fullhsize - (ncols-1)*barwidth - 2*(ncols-1)*hmargin) / ncols
  182.  
  183. \newcount\tmpcnt
  184. \tmpcnt\columnsperpage
  185. \advance \tmpcnt by -1
  186.  
  187. \hsize=\fullhsize
  188.  
  189. \temp=\barwidth
  190. \multiply \temp by \tmpcnt
  191. \advance \hsize by -\temp
  192.  
  193. \multiply \tmpcnt by 2
  194.  
  195. \temp=\hmargin
  196. \multiply \temp by \tmpcnt
  197. \advance \hsize by -\temp
  198.  
  199. \divide \hsize by \columnsperpage
  200.  
  201. % Vertical size is easy -- same amount of space above and below.
  202. %
  203. %   vsize = totalheight - (2 * vmargin)
  204.  
  205. \vsize=\totalheight
  206. \temp=\vmargin
  207. \multiply \temp by 2
  208. \advance \vsize by -\temp
  209.  
  210. % adjust the offsets so the margins are measured *from paper edge*
  211.  
  212. \hoffset=-1in \advance \hoffset by \hmargin
  213. \voffset=-1in \advance \voffset by \vmargin
  214.  
  215. % Width of items in a section.
  216.  
  217. % itmwid = (hsize - intersecwidth) * 1/3
  218. % dfnwid = (hsize - intersecwidth) * 2/3
  219.  
  220. % width of the item
  221.  
  222. \temp=\hsize
  223. \advance \temp by -\intersecwidth
  224. \divide \temp by 3
  225. \itmwid=\temp
  226.  
  227. % width of the corresponding definition
  228.  
  229. \dfnwid=\hsize
  230. \advance \dfnwid by -\itmwid
  231.  
  232. % indentation for sub items, etc.
  233.  
  234. \temp=\hsize \advance\temp by -1em
  235. \idnwid=\temp
  236.  
  237. % Width of items in an alt section.
  238.  
  239. \altitmwid=\itmwid \advance \altitmwid by 0.35in
  240. \altdfnwid=\dfnwid \advance \altdfnwid by -0.35in
  241.  
  242. % Output macros.
  243. %
  244. % Strategy:
  245. %
  246. %   * set each column in a box
  247. %   * append new columns in a global `holding' box, inserting
  248. %     intercolumn decorations as necessary.
  249. %   * when we fill a page, dump the saved box and the latest column,
  250. %     separated by the intercolumn decoration.
  251.  
  252. \newbox\holdbox
  253. \newcount\colno
  254. \colno=0
  255.  
  256. \output={\relax
  257.   \global\advance\colno by 1
  258.   \ifnum\colno=1
  259.     \global\setbox\holdbox=\columnbox
  260.   \else
  261.     \ifnum\colno=\columnsperpage
  262.       \shipout\hbox to \fullhsize{\box\holdbox\vdecor\columnbox}
  263.       \advancepageno
  264.       \global\colno=0
  265.     \else
  266.       \global\setbox\holdbox=\vbox{\hbox{\box\holdbox\vdecor\columnbox}}
  267.     \fi
  268.   \fi}
  269.  
  270. \def\columnbox{\leftline{\pagebody}}
  271.  
  272. \def\bye{\par\vfill
  273.   \supereject
  274.   \if R\lcr \null\vfill\eject \fi
  275.   \end}
  276.  
  277. % -----
  278. % Fonts
  279. % -----
  280.  
  281. \font\bbf=cmbx10
  282. \font\vbbf=cmbx12
  283. \font\smrm=cmr6
  284. \font\brm=cmr10
  285. \font\rm=cmr7
  286. \font\it=cmti7
  287. \font\tt=cmtt8
  288.  
  289. % We can afford to allow some slop
  290.  
  291. \hfuzz=1pt
  292. \vfuzz=1pt
  293. \hyphenpenalty=5000
  294. \tolerance=2000
  295. \raggedright
  296. \raggedbottom
  297. \normalbaselineskip=9pt
  298. \baselineskip=9pt
  299.  
  300. \parindent=0pt
  301. \parskip=0pt
  302. \footline={\vbox to0pt{\hss}}
  303.  
  304. \def\ctl#1{{\tt C-#1}}
  305. \def\opt#1{{\brm[{\rm #1}]}}
  306. \def\xtra#1{\noalign{\smallskip{\tt#1}}}
  307.  
  308. % A normal section
  309.  
  310. \long\def\sec#1;#2\endsec{\vskip \secskip
  311.   \halign{%
  312. %
  313. % column 1 (of halign):
  314. %
  315.     \vtop{\hsize=\itmwid\tt ##\par\vskip \lskip }\hfil
  316. %
  317. % column 2 (of halign):
  318. %
  319.     &\vtop{%
  320.       \hsize=\dfnwid
  321.       \hangafter=1
  322.       \hangindent=\intersecwidth
  323.       \rm ##\par\vskip \lskip}\cr
  324. %
  325. % Tail of \long\def fills in halign body with \sec args:
  326. %
  327.     \noalign{{\bbf #1}%
  328.       \vskip \lskip}
  329.     #2}}
  330.  
  331. \long\def\widesec#1;#2\endsec{\vskip \secskip
  332.   \halign{%
  333. %
  334. % column 1 (of halign):
  335. %
  336.     \vbox{\tt
  337.       ##\par\vskip \lskip }\cr
  338. %
  339. % Tail of \long\def fills in halign body with \sec args:
  340. %
  341.       \noalign{{\bbf #1}\vskip 3\lskip}
  342.     #2}}
  343.  
  344. % an alternate section format, used in some cases to make text fit better.
  345.  
  346. \long\def\altsec#1;#2\endsec{\vskip \secskip
  347.   \halign{%
  348. %
  349. % column 1 (of halign):
  350. %
  351.     \vtop{\hsize=\altitmwid\tt
  352.       ##\par\vskip \lskip}\hfil
  353. %
  354. % column 2 (of halign):
  355. %
  356.     &\vtop{%
  357.       \hsize=\altdfnwid
  358.       \hangafter=1
  359.       \hangindent=\intersecwidth
  360.       \rm ##\par\vskip \lskip}\cr
  361. %
  362. % Tail of \long\def fills in halign body with \sec args:
  363. %
  364.     \noalign{{\bbf #1}\vskip \lskip}
  365.     #2}}
  366.  
  367. % -------------------------------------
  368. % The actual text of the reference card
  369. % -------------------------------------
  370.  
  371. {\vbbf Octave Quick Reference}\hfil{\smrm Octave Version \octaveversion}\qquad
  372.  
  373. \sec Starting Octave;
  374. octave&start interactive Octave session\cr
  375. octave {\it file}&run Octave on commands in {\it file}\cr
  376. octave --help&describe command line options\cr
  377. \endsec
  378.  
  379. \sec Stopping Octave;
  380. quit {\rm or} exit&exit Octave\cr
  381. INTERRUPT&({\it e.g.} \ctl{c}) terminate current command and return to
  382.   top-level prompt\cr
  383. \endsec
  384.  
  385. \sec Getting Help;
  386. help&list all commands and built-in variables\cr
  387. help {\it command}&briefly describe {\it command}\cr
  388. help -i&use Info to browse Octave manual\cr
  389. help -i {\it command}&search for {\it command\/} in Octave manual\cr
  390. \endsec
  391.  
  392. \sec Motion in Info;
  393. SPC {\rm or} C-v&scroll forward one screenful\cr
  394. DEL {\rm or} M-v&scroll backward one screenful\cr
  395. C-l&redraw the display\cr
  396. \endsec
  397.  
  398. \sec Node Selection in Info;
  399. n&select the next node\cr
  400. p&select the previous node\cr
  401. u&select the `up' node\cr
  402. t&select the `top' node\cr
  403. d&select the directory node\cr
  404. <&select the first node in the current file\cr
  405. >&select the last node in the current file\cr
  406. % ]&move forward through the node structure\cr
  407. % [&move backward through the nodes\cr
  408. g&reads the name of a node and selects it\cr
  409. C-x k&kills the current node\cr
  410. \endsec
  411.  
  412. \sec Searching in Info;
  413. s&search for a string\cr
  414. C-s&search forward incrementally\cr
  415. C-r&search backward incrementally\cr
  416. i&search index \& go to corresponding node\cr
  417. ,&go to next match from last `i' command\cr
  418. \endsec
  419.  
  420. \sec Command-Line Cursor Motion;
  421. C-b&move back one character\cr
  422. C-f&move forward one character\cr
  423. C-a&move the the start of the line\cr
  424. C-e&move to the end of the line\cr
  425. M-f&move forward a word\cr
  426. M-b&move backward a word\cr
  427. C-l&clear screen, reprinting current line at top\cr
  428. \endsec
  429.  
  430. \sec Inserting or Changing Text;
  431. M-TAB&insert a tab character\cr
  432. DEL&delete character to the left of the cursor\cr
  433. C-d&delete character under the cursor\cr
  434. C-v&add the next character verbatim\cr
  435. C-t&transpose characters at the point\cr
  436. M-t&transpose words at the point\cr
  437. % M-u&uppercase the current word\cr
  438. % M-l&lowercase the current word\cr
  439. % M-c&capitalize the current word\cr
  440. \endsec
  441.  
  442. \vfill
  443. \line{\smrm \opt{ } surround optional arguments
  444.   \hfill ... show one or more arguments}
  445. \vskip0.25\baselineskip
  446. \centerline{\smrm Copyright 1996, John W. Eaton\qquad Permissions on back}
  447. \eject
  448.  
  449. \sec Killing and Yanking;
  450. C-k&kill to the end of the line\cr
  451. C-y&yank the most recently killed text\cr
  452. M-d&kill to the end of the current word\cr
  453. M-DEL&kill the word behind the cursor\cr
  454. M-y&rotate the kill ring and yank the new top\cr
  455. \endsec
  456.  
  457. \sec Command Completion and History;
  458. TAB&complete a command or variable name\cr
  459. M-?&list possible completions\cr
  460.  
  461. RET&enter the current line \cr
  462. C-p&move `up' through the history list\cr
  463. C-n&move `down' through the history list\cr
  464. M-<&move to the first line in the history\cr
  465. M->&move to the last line in the history\cr
  466. C-r&search backward in the history list\cr
  467. C-s&search forward in the history list\cr
  468.  
  469. history \opt{{-q}} \opt{{\it N\/}}&list {\it N\/} previous history lines,
  470.   omitting history numbers if {\tt -q}\cr
  471. history -w \opt{{\it file}}&write history to {\it file\/} ({\tt
  472.   \char'0176/.octave\_hist} if no {\it file\/} argument)\cr
  473. history -r \opt{{\it file}}&read history from {\it file\/} ({\tt
  474.   \char'0176/.octave\_hist} if no {\it file\/} argument)\cr
  475.  
  476. edit\_history {\it lines}&edit and then run previous
  477.   commands from the history list\cr
  478. run\_history {\it lines}&run previous commands from the
  479.   history list\cr
  480. \quad\opt{{\it beg\/}} \opt{{\it end\/}}&Specify the first and last
  481.   history commands to edit or run.\cr
  482. \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  483.   If {\it beg}\/ is greater than {\it end},
  484.   reverse the list of commands before editing.  If {\it end\/} is
  485.   omitted, select commands from {\it beg\/} to the end of the history
  486.   list.  If both arguments are omitted, edit the previous item in the
  487.   history list.}\span\cr
  488. \endsec
  489.  
  490. \sec Shell Commands;
  491. cd {\it dir}&change working directory to {\it dir}\cr
  492. pwd&print working directory\cr
  493. ls \opt{{\it options}}&print directory listing\cr
  494. getenv ({\it string})&return value of named environment variable\cr
  495. system ({\it cmd})&execute arbitrary shell command string\cr
  496. \endsec
  497.  
  498. \sec Matrices;
  499. \omit\vbox{\rm\vskip0.25ex
  500.   Square brackets delimit literal matrices.  Commas separate elements
  501.   on the same row.  Semicolons separate rows.  Commas may be replaced
  502.   by spaces, and semicolons may be replaced by one or more newlines.
  503.   Elements of a matrix may be arbitrary   expressions, provided that
  504.   all the dimensions agree.\vskip0.75ex}\span\cr
  505. [ {\it x}, {\it y}, ... ]&enter a row vector\cr
  506. [ {\it x}; {\it y}; ... ]&enter a column vector\cr
  507. [ {\it w}, {\it x}; {\it y}, {\it z} ]&enter a 2$\times$2 matrix\cr
  508. \endsec
  509.  
  510. \sec Ranges;
  511. {\it base} : {\it limit}\cr
  512. {\it base} : {\it incr} : {\it limit}\cr
  513. \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.75ex
  514.   Specify a range of values beginning with {\it base\/} with no elements
  515.   greater than {\it limit}.  If it is omitted, the default value of
  516.   {\it incr\/} is 1.  Negative increments are permitted.}\span\cr
  517. \endsec
  518.  
  519. \vfill\eject
  520.  
  521. \sec Strings and Common Escape Sequences;
  522. \omit\vbox{\rm\vskip0.5ex
  523.   A {\it string constant\/} consists of a sequence of characters
  524.   enclosed in either double-quote or single-quote marks.\vskip0.75ex}\span\cr
  525. \char'134\char'134&a literal backslash\cr
  526. \char'134 "&a literal double-quote character\cr
  527. \char'134 '&a literal single-quote character\cr
  528. \char'134 n&newline, ASCII code 10\cr
  529. \char'134 t&horizontal tab, ASCII code 9\cr
  530. \endsec
  531.  
  532. \sec Index Expressions;
  533. {\it var} ({\it idx})&select elements of a vector\cr
  534. {\it var} ({\it idx1}, {\it idx2})&select elements of a matrix\cr
  535.  
  536. \quad {\it scalar}&select row (column) corresponding to {\it scalar}\cr
  537. \quad {\it vector}&select rows (columns) corresponding to the elements
  538.   of {\it vector}\cr
  539. \quad {\it range}&select rows (columns) corresponding to the elements
  540.   of {\it range}\cr
  541. \quad :&select all rows (columns)\cr
  542. \endsec
  543.  
  544. \sec Global Variables;
  545. global {\it var1} ...&Declare variables global.\cr
  546. \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  547.   Global variables may be accessed inside the body of a function
  548.   without having to be passed in the function parameter list provided
  549.   they are also declared global within the function.}\span\cr
  550. \endsec
  551.  
  552. \sec Selected Built-in Variables;
  553. EDITOR&editor to use with {\tt edit\_history}\cr
  554. Inf, NaN&IEEE infinity, NaN\cr
  555. LOADPATH&path to search for function files\cr
  556. PAGER&program to use to paginate output\cr
  557. ans&last result not explicitly assigned\cr
  558. eps&machine precision\cr
  559. pi&$\pi$\cr
  560. realmax&maximum representable value\cr
  561. realmin&minimum representable value\cr
  562. \endsec
  563. \vskip -\secskip
  564. \vskip -2\lskip
  565. \altsec \null;
  566. automatic\_replot&automatically redraw plots\cr
  567. do\_fortran\_indexing&Fortran-style indexing of matrices\cr
  568. implicit\_str\_to\_num\_ok&allow strings to become numbers\cr
  569. output\_max\_field\_width&maximum numeric field width\cr
  570. output\_precision&min significant figures displayed\cr
  571. page\_screen\_output&control whether output is paged\cr
  572. prefer\_column\_vectors&create column vectors by default\cr
  573. resize\_on\_range\_error&automatic resizing of matrices\cr
  574. save\_precision&digits stored by {\tt save} command\cr
  575. silent\_functions&suppress output from functions\cr
  576. warn\_divide\_by\_zero&suppress divide by zero errors\cr
  577. \endsec
  578. \vskip -\secskip
  579. \vskip -2\lskip
  580. \widesec \null;
  581. commas\_in\_literal\_matrix\vskip\lskip\cr
  582. \omit\hfill\vbox{\hsize=\idnwid\rm
  583.   control handling of spaces in matrices\vskip3\lskip}\cr
  584. ignore\_function\_time\_stamp\cr
  585. \omit\hfill\vbox{\hsize=\idnwid\rm
  586.   ignore changes in function files during session\vskip3\lskip}\cr
  587. ok\_to\_lose\_imaginary\_part\cr
  588. \omit\hfill\vbox{\hsize=\idnwid\rm
  589.   allow complex to real conversion\vskip3\lskip}\cr
  590. prefer\_zero\_one\_indexing\cr
  591. \omit\hfill\vbox{\hsize=\idnwid\rm
  592.   if ambiguous, prefer 0-1 style indexing\vskip3\lskip}\cr
  593. \endsec
  594.  
  595. \vfill\eject
  596.  
  597. \sec Arithmetic and Increment Operators;
  598. {\it x} + {\it y}&addition\cr
  599. {\it x} - {\it y}&subtraction\cr
  600. {\it x} * {\it y}&matrix multiplication\cr
  601. {\it x} .* {\it y}&element by element multiplication\cr
  602. {\it x} / {\it y}&right division, conceptually equivalent to
  603.   {\tt (inverse~(y')~*~x')'}\cr
  604. {\it x} ./ {\it y}&element by element right division\cr
  605. {\it x} \char'134{} {\it y}&left division, conceptually equivalent to
  606.   {\tt inverse~(x)~*~y}\cr
  607. {\it x} .\char'134{} {\it y}&element by element left division\cr
  608. {\it x} \char'136{} {\it y}&power operator\cr
  609. {\it x} .\char'136{} {\it y}&element by element power operator\cr
  610. - {\it x}&negation\cr
  611. + {\it x}&unary plus (a no-op)\cr
  612. {\it x} '&complex conjugate transpose\cr
  613. {\it x} .'&transpose\cr
  614. ++ {\it x}\quad{\rm(}-- {\it x}{\rm)}&increment (decrement) {\it x},
  615.   return {\it new\/} value\cr
  616. {\it x} ++\quad{\rm(}{\it x} --{\rm)}&increment (decrement) {\it x},
  617.   return {\it old\/} value\cr
  618. \endsec
  619.  
  620. \sec Assignment Expressions;
  621. {\it var} = {\it expr}&assign expression to variable\cr
  622. {\it var} ({\it idx}) = {\it expr}&assign expression to indexed variable\cr
  623. \endsec
  624.  
  625. \sec Comparison and Boolean Operators;
  626. \omit \vbox{\rm\vskip0.75ex
  627.   These operators work on an element-by-element basis.  Both arguments
  628.   are always evaluated.\vskip0.75ex}\span\cr
  629. {\it x} < {\it y}&true if {\it x\/} is less than {\it y}\cr
  630. {\it x} <= {\it y}&true if {\it x\/} is less than or equal to {\it y}\cr
  631. {\it x} == {\it y}&true if {\it x\/} is greater than {\it y}\cr
  632. {\it x} >= {\it y}&true if {\it x\/} is greater than or equal to {\it y}\cr
  633. {\it x} > {\it y}&true if {\it x\/} is equal to {\it y}\cr
  634. {\it x} != {\it y}&true if {\it x\/} is not equal to {\it y}\cr
  635. {\it x} \& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr
  636. {\it x} | {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr 
  637. ! {\it bool}&true {\it bool\/} is false\cr
  638. \endsec
  639.  
  640. \sec Short-circuit Boolean Operators;
  641. \omit \vbox{\rm\vskip0.75ex
  642.   Operators evaluate left-to-right, expecting scalar operands.
  643.   Operands are only evaluated if necessary, stopping once overall
  644.   truth value can be determined.  Operands are converted to scalars by
  645.   applying the {\tt all} function.\vskip0.75ex}\span\cr   
  646. {\it x} \&\& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr
  647. {\it x} || {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr
  648. \endsec
  649.  
  650. \sec Operator Precedence;
  651. \omit \vbox{\rm\vskip0.5ex
  652.   Here is a table of the operators in Octave, in order of increasing
  653.   precedence.\vskip0.75ex}\span\cr
  654. ;\ \ ,&statement separators\cr
  655. =&assignment, groups left to right\cr
  656. ||\ \ \&\&&logical ``or'' and ``and''\cr
  657. |\ \ \&&element-wise ``or'' and ``and''\cr
  658. < <= == >= > !=&relational operators\cr
  659. :&colon\cr
  660. +\ \ -&addition and subtraction\cr
  661. * / \char'134\ \ .*\ \ ./\ \ .\char'134&multiplication and division\cr
  662. '\ \ .'&transpose\cr
  663. +\ \ -\ \ ++\ \ --\ \ !&unary minus, increment, logical ``not''\cr
  664. \char'136\ \ .\char'136&exponentiation\cr
  665. \endsec
  666.  
  667. \vfill\eject
  668.  
  669. \widesec Statements;
  670. for {\it identifier} = {\it expr} {\it stmt-list} endfor\cr
  671. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  672.   Execute {\it stmt-list} once for each column of {\it expr}.  The
  673.   variable {\it identifier} is set to the value of the current column
  674.   during each iteration.}\cr\cr
  675. while ({\it condition}) {\it stmt-list} endwhile\cr
  676. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  677.   Execute {\it stmt-list} while {\it condition} is true.}\cr\cr
  678. \hbox{\vtop{\hsize=\itmwid\tt break}
  679.   \vtop{\hsize=\dfnwid\rm exit innermost loop}}\cr
  680. \hbox{\vtop{\hsize=\itmwid\tt continue}
  681.   \vtop{\hsize=\dfnwid\rm go to beginning of innermost loop}}\cr
  682. \hbox{\vtop{\hsize=\itmwid\tt return}
  683.   \vtop{\hsize=\dfnwid\rm return to calling function}}\cr\cr
  684. if ({\it condition}) {\it if-body} \opt{{\tt else} {\it else-body}} endif\cr
  685. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  686.   Execute {\it if-body} if {\it condition} is true, otherwise execute
  687.   {\it else-body}.}\cr
  688. if ({\it condition}) {\it if-body} \opt{{\tt elseif} ({\it condition})
  689.   {\it elseif-body}} endif\cr
  690. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  691.   Execute {\it if-body} if {\it condition} is true, otherwise execute
  692.   the {\it elseif-body} corresponding to the first {\tt elseif}
  693.   condition that is true, otherwise execute {\it else-body}.}\cr
  694. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  695.   Any number of {\tt elseif} clauses may appear in an {\tt if}
  696.   statement.}\cr\cr
  697. unwind\_protect {\it body} unwind\_protect\_cleanup {\it cleanup} end\cr
  698. \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex
  699.   Execute {\it body}.  Execute {\it cleanup} no matter how control
  700. exits {\it body}.}\cr
  701. \endsec
  702.  
  703. \widesec Defining Functions;
  704. function \opt{{\it ret-list}} {\it function-name}
  705.   \opt{\hskip0.2em({\it arg-list})\hskip0.2em}\cr
  706. \quad{\it function-body}\cr
  707. endfunction\cr\cr
  708. {\rm {\it ret-list\/} may be a single identifier or a comma-separated
  709.   list of identifiers delimited by square-brackets.\vskip0.75ex}\cr
  710. {\rm {\it arg-list\/} is a comma-separated list of identifiers and may
  711.   be empty.}\cr
  712. \endsec
  713.  
  714. \sec Basic Matrix Manipulations;
  715. rows ({\it a})&return number of rows of {\it a}\cr
  716. columns ({\it a})&return number of columns of {\it a}\cr
  717. all ({\it a})&check if all elements of {\it a\/} nonzero\cr
  718. any ({\it a})&check if any elements of {\it a\/} nonzero\cr
  719. find ({\it a})&return indices of nonzero elements\cr
  720. sort ({\it a})&order elements in each column of {\it a}\cr
  721. sum ({\it a})&sum elements in columns of {\it a}\cr
  722. prod ({\it a})&product of elements in columns of {\it a}\cr
  723. min ({\it args})&find minimum values\cr
  724. max ({\it args})&find maximum values\cr
  725. rem ({\it x}, {\it y})&find remainder of {\it x}/{\it y}\cr
  726. reshape ({\it a}, {\it m}, {\it n})&reformat {\it a} to be {\it m} by
  727.   {\it n}\cr\cr
  728. diag ({\it v}, {\it k})&create diagonal matrices\cr
  729. linspace ({\it b}, {\it l}, {\it n})&create vector of linearly-spaced
  730.   elements\cr
  731. logspace ({\it b}, {\it l}, {\it n})&create vector of log-spaced
  732.   elements\cr
  733. eye ({\it n}, {\it m})&create {\it n\/} by {\it m\/} identity matrix\cr
  734. ones ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of ones\cr
  735. zeros ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of zeros\cr
  736. rand ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of random
  737.   values\cr 
  738. \endsec
  739.  
  740. \vfill\eject
  741.  
  742. % sin({\it a}) cos({\it a}) tan({\it a})&trigonometric functions\cr
  743. % asin({\it a}) acos({\it a}) atan({\it a})&inverse trigonometric functions\cr
  744. % sinh({\it a}) cosh({\it a}) tanh({\it a})&hyperbolic trig functions\cr
  745. % asinh({\it a}) acosh({\it a}) atanh({\it a})&inverse hyperbolic trig
  746. % functions\cr\cr 
  747.  
  748. \sec Linear Algebra;
  749. chol ({\it a})&Cholesky factorization\cr
  750. det ({\it a})&compute the determinant of a matrix\cr
  751. eig ({\it a})&eigenvalues and eigenvectors\cr
  752. expm ({\it a})&compute the exponential of a matrix\cr
  753. hess ({\it a})&compute Hessenberg decomposition\cr
  754. inverse ({\it a})&invert a square matrix\cr
  755. norm ({\it a}, {\it p})&compute the {\it p}-norm of a matrix\cr
  756. pinv ({\it a})&compute pseudoinverse of {\it a}\cr
  757. qr ({\it a})&compute the QR factorization of a matrix\cr
  758. rank ({\it a})&matrix rank\cr
  759. schur ({\it a})&Schur decomposition of a matrix\cr
  760. svd ({\it a})&singular value decomposition\cr
  761. syl ({\it a}, {\it b}, {\it c})&solve the Sylvester equation\cr
  762. \endsec
  763.  
  764. \sec Equations, ODEs, DAEs, Quadrature;
  765. *fsolve&solve nonlinear algebraic equations\cr
  766. *lsode&integrate nonlinear ODEs\cr
  767. *dassl&integrate nonlinear DAEs\cr
  768. *quad&integrate nonlinear functions\cr\cr
  769. perror ({\it nm}, {\it code})&for functions that return numeric
  770.   codes, print error message for named function and given error
  771.   code\cr\cr
  772. \omit \vbox{\rm
  773.   {\tt *} See the on-line or printed manual for the complete list of
  774.   arguments for these functions.}\span\cr
  775. \endsec
  776.  
  777. \sec Signal Processing;
  778. fft ({\it a})&Fast Fourier Transform using FFTPACK\cr
  779. ifft ({\it a})&inverse FFT using FFTPACK\cr
  780. freqz ({\it args})&FIR filter frequency response\cr
  781. sinc ({\it x})&returns {\tt sin ($\pi$ x)/($\pi$ x)}\cr
  782. \endsec
  783.  
  784. \altsec Image Processing;
  785. colormap ({\it map})&set the current colormap\cr
  786. gray2ind ({\it i}, {\it n})&convert gray scale to Octave image\cr
  787. image ({\it img}, {\it zoom})&display an Octave image matrix\cr
  788. imagesc ({\it img}, {\it zoom})&display scaled matrix as image\cr
  789. imshow ({\it img}, {\it map})&display Octave image\cr
  790. imshow ({\it i}, {\it n})&display gray scale image\cr
  791. imshow ({\it r}, {\it g}, {\it b})&display RGB image\cr
  792. ind2gray ({\it img}, {\it map})&convert Octave image to gray scale\cr
  793. ind2rgb ({\it img}, {\it map})&convert indexed image to RGB\cr
  794. loadimage ({\it file})&load an image file\cr
  795. rgb2ind ({\it r}, {\it g}, {\it b})&convert RGB to Octave image\cr
  796. \omit\tt saveimage ({\it file}, {\it img}, {\it fmt}, {\it map})\quad\rm
  797. save a matrix to {\it file}\span\cr
  798. \endsec
  799.  
  800. \altsec Sets;
  801. create\_set ({\it a}, {\it b})&create row vector of unique values\cr
  802. complement ({\it a}, {\it b})&elements of {\it b} not in {\it a}\cr
  803. intersection ({\it a}, {\it b})&intersection of sets {\it a} and {\it b}\cr
  804. union ({\it a}, {\it b})&union of sets {\it a} and {\it b}\cr
  805. \endsec
  806.  
  807. \altsec Strings;
  808. strcmp ({\it s}, {\it t})&compare strings\cr
  809. strcat ({\it s}, {\it t}, ...)&concatenate strings\cr
  810. \endsec
  811.  
  812. \vfill\eject
  813.  
  814. \altsec C-style Input and Output;
  815. fopen ({\it name}, {\it mode})&open file {\it name}\cr
  816. fclose ({\it file})&close {\it file}\cr
  817. printf ({\it fmt}, ...)&formatted output to {\tt stdout}\cr
  818. fprintf ({\it file}, {\it fmt}, ...)&formatted output to {\it file}\cr
  819. sprintf ({\it fmt}, ...)&formatted output to string\cr
  820. scanf ({\it fmt})&formatted input from {\tt stdin}\cr
  821. fscanf ({\it file}, {\it fmt})&formatted input from {\it file}\cr
  822. sscanf ({\it str}, {\it fmt})&formatted input from {\it string}\cr
  823. fgets ({\it file}, {\it len})&read {\it len\/} characters from {\it file\/}\cr
  824. fflush ({\it file})&flush pending output to {\it file}\cr
  825. ftell ({\it file})&return file pointer position\cr
  826. frewind ({\it file})&move file pointer to beginning\cr
  827. freport&print a info for open files\cr
  828. fread ({\it file}, {\it size}, {\it prec})&read binary data files\cr
  829. fwrite ({\it file}, {\it size}, {\it prec})&write binary data files\cr
  830. feof ({\it file})&determine if pointer is at EOF\cr
  831. \omit \vbox{\rm\vskip0.75ex
  832.   A file may be referenced either by name or by the number returned
  833.   from {\tt fopen}.  Three files are preconnected when Octave starts:
  834.   {\tt stdin}, {\tt stdout}, and {\tt stderr}.\vskip0.75ex}\span\cr
  835. \endsec
  836.  
  837. \sec Other Input and Output functions;
  838. save {\it file} {\it var} ...&save variables in {\it file}\cr
  839. load {\it file}&load variables from {\it file}\cr
  840. disp ({\it var})&display value of {\it var} to screen\cr
  841. \endsec
  842.  
  843. \sec Miscellaneous Functions;
  844. eval ({\it str})&evaluate {\it str} as a command\cr
  845. feval ({\it str}, ...)&evaluate function named by {\it str},
  846.   passing remaining args to called function\cr\cr
  847. error ({\it message})&print message and return to top level\cr\cr
  848. clear {\it pattern}&clear variables matching pattern\cr
  849. exist ({\it str})&check existence of variable or function\cr
  850. who&list current variables\cr
  851. \endsec
  852.  
  853. \sec Polynomials;
  854. compan ({\it p})&companion matrix\cr
  855. conv ({\it a}, {\it b})&convolution\cr
  856. deconv ({\it a}, {\it b})&deconvolve two vectors\cr
  857. poly ({\it a})&create polynomial from a matrix\cr
  858. polyderiv ({\it p})&derivative of polynomial\cr
  859. polyreduce ({\it p})&integral of polynomial\cr
  860. polyval ({\it p}, {\it x})&value of polynomial at {\it x}\cr
  861. polyvalm ({\it p}, {\it x})&value of polynomial at {\it x}\cr
  862. roots ({\it p})&polynomial roots\cr
  863. residue ({\it a}, {\it b})&partial fraction expansion of
  864. ratio {\it a}/{\it b}\cr
  865. \endsec
  866.  
  867. \sec Statistics;
  868. corrcoef ({\it x}, {\it y})&correlation coefficient\cr
  869. cov ({\it x}, {\it y})&covariance\cr
  870. mean ({\it a})&mean value\cr
  871. median ({\it a})&median value\cr
  872. std ({\it a})&standard deviation\cr
  873. var ({\it a})&variance\cr
  874. \endsec
  875.  
  876. \vfill\eject
  877.  
  878. \sec Basic Plotting;
  879. \omit \vbox{\tt
  880. gplot \opt{{\it ranges}} {\it expr} \opt{{\it using}}
  881.   \opt{{\it title}} \opt{{\it style}}\hfill{\rm 2D plotting}
  882.   \par\vskip \lskip}\span\cr
  883. \omit \vbox{\tt
  884. gsplot \opt{{\it ranges}} {\it expr} \opt{{\it using}}
  885.   \opt{{\it title}} \opt{{\it style}}\hfill{\rm 3D plotting}
  886.   \par\vskip \lskip}\span\cr
  887. \quad{\it ranges}&specify data ranges\cr
  888. \quad{\it expr}&expression to plot\cr
  889. \quad{\it using}&specify columns to plot\cr
  890. \quad{\it title}&specify line title for legend\cr
  891. \quad{\it style}&specify line style\cr
  892. \omit \vbox{\rm\vskip0.85ex 
  893.   If {\it ranges\/} are supplied, they must come before the expression
  894.   to plot.  The {\it using\/}, {\it title\/}, and {\it style\/}
  895.   options may appear in any order after {\it expr\/}.  Multiple
  896.   expressions may be plotted with a single command by separating them
  897.   with commas.\vskip1ex}\span\cr
  898. set {\it options}&set plotting options\cr
  899. show {\it options}&show plotting options\cr
  900. replot&redisplay current plot\cr
  901. closeplot&close stream to {\tt gnuplot} process\cr
  902. purge\_tmp\_files&clean up temporary plotting files\cr
  903. automatic\_replot&built-in variable\cr
  904. \endsec
  905.  
  906. \sec Other Plotting Functions;
  907. plot ({\it args})&2D plot with linear axes\cr
  908. semilogx ({\it args})&2D plot with logarithmic x-axis\cr
  909. semilogy ({\it args})&2D plot with logarithmic y-axis\cr
  910. loglog ({\it args})&2D plot with logarithmic axes\cr
  911. bar ({\it args})&plot bar charts\cr
  912. stairs ({\it x}, {\it y})&plot stairsteps\cr
  913. hist ({\it y}, {\it x})&plot histograms\cr\cr
  914. title ({\it string})&set plot title\cr\cr
  915. axis ({\it limits})&set axis ranges\cr
  916. xlabel ({\it string})&set x-axis label\cr
  917. ylabel ({\it string})&set y-axis label\cr
  918. grid \opt{on$|$off}&set grid state\cr
  919. hold \opt{on$|$off}&set hold state\cr
  920. ishold&return 1 if hold is on, 0 otherwise\cr\cr
  921. mesh ({\it x}, {\it y}, {\it z})&plot 3D surface\cr
  922. meshdom ({\it x}, {\it y})&create mesh coordinate matrices\cr
  923. \endsec
  924.  
  925. \vskip 0pt plus 2fill
  926. \hrule width \hsize
  927. \par\vskip10pt
  928. {\smrm\parskip=6pt
  929. Edition \refcardedition for Octave Version \octaveversion.  Copyright
  930. 1996, John W. Eaton
  931. (jwe@che.utexas.edu).  The author assumes no responsibility for any
  932. errors on this card.
  933.  
  934. This card may be freely distributed under the terms of the GNU
  935. General Public License.
  936.  
  937. \TeX{} Macros for this card by Roland Pesch (pesch@cygnus.com),
  938. originally for the GDB reference card
  939.  
  940. Octave itself is free software; you are welcome to distribute copies of
  941. it under the terms of the GNU General Public License.  There is
  942. absolutely no warranty for Octave.
  943. }
  944.  
  945. \end
  946.  
  947. % For AUCTeX:
  948. %
  949. % Local Variables: 
  950. % mode: tex
  951. % TeX-master: t
  952. % End: 
  953.